
#ifndef _MEMBER_BTabWidget_H_
#define _MEMBER_BTabWidget_H_

#include <BRect>
#include <BArray>
#include <BAction>
#include <BIcon>
#include <BStyle>
#include <BTabWidget>
#include "ITabBoard.h"

#define tab_member(tab)		((member_BTabWidget*)((BTabWidget*)tab)->_ptr)

namespace BWE
{
	class member_BTabWidget : public BObject
	{
		friend class BTabWidget;
	public:
		member_BTabWidget(BTabWidget* tabWidget);
		~member_BTabWidget();

		void slotCloseClicked(BObject* object, const BValue& value);
		void slotTitleChanged(BObject* object, const BValue& value);
		void slotBoardActived(BObject* object, const BValue& value);
		void slotArrowChecked(BObject* object, const BValue& value);

		void freshTabs();
		void reviseTab();

		int index(BWidget* widget);
		BRect rectOf(BWidget* widget);

		BTabWidget*			boss;
		Align				tabAlign;
		Form				tabForm;
		Part				tabPart;
		int					tabSpacing;
		BMargin			tabMargin;
		BSize				iconSize;
		BSize				buttonSize;
		bool				hintTabs;
		BHolder<BButton>	arrow;
		BHolder<ITabBoard>	board;
		BStyleHolder		closeStyle;

		bool				dirty;
		BRect				tabArea;
		BSize				tabsSizeHint;
		int					beginIndex;
		int					hoverIndex;
		bool				pressed;
		BWidgetArray		stack;
		BList<TabItem>		items;
	};
}

#endif